#pragma once

#include <string>
#include <json/json.h>

namespace zenopy {

struct PythonClient {
private:
    struct Impl;
    std::unique_ptr<Impl> m_impl;

    std::string _send(int sock, std::string const &jsonData, bool needRecv = true);
    Json::Value _exec(int sock, std::string code, Json::Value jsonArg);
    void _close(int sock);

public:
    PythonClient();
    ~PythonClient();
    void open(const char *socketFile, size_t nWorkers = 0);
    Json::Value exec(std::string code, Json::Value jsonArg);
};

}
